package com.atguigu.utils;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * @author Chen
 * @Description
 * @Version
 * @create 2021-10-19-17:55
 */
public class PropertiesUtils {
    private static final String NAME = "url.properties";

    public static String readProperties(String str) {
        Properties properties = new Properties();
        InputStream resourceAsStream = PropertiesUtils.class.getClassLoader().getResourceAsStream(NAME);
        try {
            properties.load(resourceAsStream);
            return properties.getProperty(str);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return "";
    }
}
